package com.runda.system.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.runda.entity.JwtUser;
import com.runda.sec.SecContextUtil;
import com.runda.sec.vo.UserVo;

@RestController
@RequestMapping("sec")
public class SecurityController {
	@GetMapping("user")
	public UserVo getUser() {
		JwtUser user=SecContextUtil.getCurrentUser();
		UserVo vo=new UserVo(user.getId(),user.getUsername());	
		return vo;
	}
}
